Fixed exceptions. Fixed formatting (PEP-8 compliance).