Fixing some syntactic stuff and general Python errors