Corrected some syntactic and semantic errors

Only three! Not bad for something written without being tested.