categories_config.php calculated field "CurrentSort" is used without table alias. This may be a problem if customization requires additional join. For example, join on same Categories table to get access to some parent category field values. In this case we get following SQL error "1052: Column 'ParentPath' in field list is ambiguous".
I suggest use before ParentPath same prefix '%1$s' as before CategoryId field.