Add undefined arg test and fix hanging handler

/to @raymondfeng