fixes and style improvements