fixed up a couple of corner cases