Some more error preventing stuff

Signed-off-by: Andre Schweiger <andre.spiele@yahoo.de>