Some fixes. Added profiler.