minor fixes to make this thing work finally!