WIP
Fix a few bugs