Added test script for npm, fixed resolve procedure: added type check for x