Fix module checking to pass JS Lint