Improve formatting and minor bugfix