Fix a few problems