fixed more bugs found through the validator