Nullpointer bugfix