properly catch exceptions caused by illegal targets, fixes #93