Improved error reporting

Signed-off-by: Vinzenz Feenstra <evilissimo@gmail.com>