Array access error on request.error listener.

Fixed that bug and provides a simple Testcase.