Bugfixes and style changes