Throw exception if alias is invalid.

Proposed fix for Issue #7.