Multiple fixes of some small bugs.