Hotfix/issue #5772 token processor booleans

Hotfix for #5772

Also includes cleanups and stripping empty string replacements.