Fix for repeated variables in instance head

Variables should only be brought into scope once! So remove any repeated
variables and only bind them once.
Merge pull request #1255 from david-christiansen/error-reflection

Fix IDESlave reporting of ProofSearchFail
Fix missing function call from 723d972b2