Bugfixes and tweeks.