Fix problems with test(), require inside function
Merge pull request #3 from nova1311/master

Fix problems with test(), require inside function