Some minor bug fixes

see above