Fixed error handling
Merge origin/master