bugfixes all around