Some style fixes and fix #6