SQL grammar exception fix.