Fixed fftw as dynamic library, and more optimized