Improving the tests, and fixing a bug in input array handling