Made SOM refinement faster, fixed bug in profilemanager