Some bugfixing.