Bugfixes; style fixes