Rewrites string formatting for error messages
Changes to match PEP8