The invalid gender class, does not throw exception when wrong input is given. For example, I gave the letter 'G' and i got no exception.
Thanks for the bug report! The problem somehow occurs in the checking part of the gender. The gender right now is not coded properly and check only if it's not a digit or it is. The checking condition has been changed. The bug is now resolved.