Fix a couple of bugs testing brought up.