Code profiling optimized - fixed #9