General bugfixing.