Fix a few more bugs