Fix lots of issues