Nullpointer in test fixed