Fixed issues with running npm test

Identified several issues in many places both in tests and definitions.
Fixed.