Some fixes.

It was supposed to be a one commit. Sorry for that.