Merge in sorting UI Field

Also fixes a few script issues.