Added some slightly redundant letter case checking to appease the tests and resolved some other small issues