fixed optiont parser to handle optlen = 0