Fix a lot of issues