minor fixes to make it actually work