Mostly bugfixes