Merge pull request #545 from iki/fix/setupjs-and-tests

Fix setup.js and tests