fix nullpointerexception and some ui tests