Added nicer error printout, sorted the used keys keys to display and re-added an error check for when there were no elements to substitute.
Added nicer error printout, sorted the used keys keys to display and re-added an error check for when there were no elements to substitute.

jburell/proper,jburell/proper