Fix a couple of bugs.