Improve compatibility of end-to-end tests

Node throws a TypeError for trying to call a method that doesn't
exist, but the message in the exception is different.

node 0.10.x: "Cannot call method 'apply' on undefined"
node 0.11.x: "Cannot read property 'apply' on undefined"