FIX: Better error handling
Merge pull request #488 from Eric89GXL/inv-doublecheck

FIX: Better error handling