More bug fixes
More general bugfixes