Many minor bugfixes and aesthetic improvements