Yeah...no...trust us, that is way too overstocked. Those are really bad living conditions. Like I said, I would personally go with 20 galons for that sort of arrangement.
Just because they were 'fine' doesn't mean they actually were. First off, they were in such a cramped place that it probably stunted their growth. Doesn't really seem fine...especially since it leads to unhappy and unhealthy fish.
Not to mention all the waste that must have been in a tiny tank with all those fish!
And to top it off, they weren't housed in groups like they should be...so they wouldn't be 'fine' for long, and one of your glofish did die.
So please take our advice and get proper homes for your fish, as well as some tankmates.