Bugfixes and style fixes.