Many bugfixes.