Fix code warnings

Merged Stefan Warnat requested to merge fixes into master

Apply some code recommendations from npm

Merge request reports