Fix a few small defects