Some minor, but important bugfixes