Some fixes

Just some random bug fixes I stumbled accross.
Some of them are already fixed in later versions.