Check for null target in avoidProxy to prevent exceptions; Close #560.

Why shouldn't this crash?