Removed duplicate code
Merge pull request #91 from andig/tests

Merging as only test cases affected.