fixes to code to get it to compile clean