Tons of syntax fixes and at least a bugfix