Fixed issue #1938 about supporting graph elements in include/exclude functions