Minor bug fixes
Some more minor bug fixes