Added detection, morphology, and scale_img tests

And also some minor fixes along the way.  This PR raises our test coverage from 77% to 91%.