Minor fixes and cosmetics

See commits for details