Multiple fixes of some small bugs.

Can we break it down to multiple lines or add space after the comma to improve readability?