Fix a couple bugs