Fix a few detail bugs