Fixed an error in the constructor.
added a test script.