Instead of returning false, throw reasonable error.  Added support for 'optional' option.