minor fixes to make this crap compilable