In the default settings, when you cast a spell without target (or in this case, when your target is not valid), the spell gets cast on yourself. It's somewhere in the character settings I think, and you can disable it.