Fix a few little bugs