Fix a couple of errors found while doing a test run