bug fixes to get it to compile