Some smaller bugfixes