Fixed tests and null-pointer