Fix a couple of small bugs