Minor bugfixes and format changes for a few lines