fix npm issues, fix tests