Fix autorun on $.ajax error

Closes #190 and #202