Fix #29: Exception handling improved.
PEP8 + code cleanup.
Merge.