Fix a couple of edge cases.