Minor Bugfixes like nullpointer exception fix