Fix npm build errors