fix crashes

Tested on bennet.

optimized fractal algorithm took 10.29 seconds