misc fixes, reformatting