Some bugfixes.