[BZ 1051299] Check for illegal arguments passed to the helper methods an...

...d throw an adequate exception to present more info to the user.