Minor bugfixes and style changes