Fix NullPointers

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