Fix a few bugs
rebuild