Fixed and issue with some some incorrect sql that cause the complete pay...

...ment buttons to not work correctly.  Some other minor tweaks