Major bugfixes.