bugfixes (forgot to run tests)