Fix hasOptions() function, so that no false positives occur anymore.
(cherry picked from commit ab6aaebbe8e23c8fafb8e9cb262318345f935df8)