Partial bugfixing