Fix issue 106 and add tests for different input types