Added some test code
Minor bugfix