fixes #3087 - fix space before parenthesis warning

(cherry picked from commit 90c74cf4388dea9924a4079b109ebce3fd22515d)
fixes #3071 - OS edit failed on foreign keys since config_template_id was '0' on blank

(cherry picked from commit f76e5eee7dcbea2bdcfb15beec84894214133093)