fixed bug where uppercase ok/pk alias in query would break query; fixed
bug that caused wrong maxOk1 value to sometime be logged