I think that your problem would also most likely be found in your water parameters. You state that your ammonia levels are all 'fine', however there are also nitrIte and nitrAte levels to consider, and even a few more after that.
Can you tell us what your ammonia, nitrIte, and nitrAte levels are?
It seems as if you already recognize that ammonia is going to be toxic to your fish. However, nitrItes are just as toxic as ammonia, and nitrAtes, while still toxic, are deadly in higher amounts only.
You may want to look over this 'sticky' article about cycling a fish tank to familiarize yourself or re-familiarize yourself with the process:
http://www.fishtankforums.com/5-fres...-aquarium.html
This article will also give you some insight into how stocking a fish tank can impact the water quality. While I realize that most of your fish are small, and your tank is 40 gallons, having 22 fish in a tank is going to result in a lot of wastes and thus become difficult for you to keep the water quality in healthy ranges.
Knowing your water parameters (ammonia, nitrite, and nitrate) would really help us help you.