Various fixes

Code format should be uniform. PEP8 says not to add spaces around parentheses.