JS module tests
Fix JSHint error
Better validity check in the base