error if optlen not what we expected - see #141