Fixing issue #1104 and updating tests.

But `$arg` is not in the condition anymore so it's not probable for anyone to misuse it again.
Also there is a test for it which holds it from happening again.