Fixed tests crashes.