Minor bug-fixes