Fix null-pointer exception.