More precise error handling to reduce error rate
Closes #167 (closed).
Please only review the last commit as first 3 don't do anything material.
Edited by Mikhail Mazurskiy
Closes #167 (closed).
Please only review the last commit as first 3 don't do anything material.