Guard against trying to read args from a shell function object in def.js

Closes #238
Merge remote-tracking branch 'upstream/master'