Fix a couple bugs with the previous commit