Fixed PEP8 errors

Fixed PEP8 errors and some other minor errors.