Issue #1994880 by 1an_m: Improved comparebyOptionals function.
Merge pull request #48 from plopesc/issue-1994880

Issue #1994880 by 1an_m: Improved comparebyOptionals function.