fix bug in invokeCharAt and reverse parameters before invoke