Mysql findKeys bug fix

Sorry to bother again, but the mysql findKeys function did not work proper. Fixed tests to catch this and fixed the function.