Finished bugfixing