Segmantation fault fix. Prepare speed-up.