minor fixes to make it work through npm