Fixed error in sorting algorithm, improved table checking, don't render chart when there are errors in the profile