Fix profiler bug

Need to sort symbols after reading because they aren't necessarily in order (this
behavior may have changed with a toolkit upgrade)
Also cleaned up a bit.