minor fixes to code