Fix operator== for invalid optionals, close #191