Multiple fixes of some small bugs.

I like it! :)