Fix a couple of instances in the unit tests where I was using `.then()` on the final use of a promise instead of `.done()`.
Remove some unnecessary edge-case handling and add a few more unit tests to get coverage to 100%.