clean up minor variable scoping issues
Fix Railo syntax error around checking for column existing
Various fixes to try and capture the external error id