Handle exception in dynamic analysis

This closes #14.