Adding exception for invalid mock definitions