Applying changes to fit PEP8, fixing minor issues with tab/space mix