Catch some possible errors

Signed-off-by: Lars Kiesow <lkiesow@uos.de>