slightly better fixes to close #330
Merge branch 'master' into formatting