Added OR support (reverse-merged from commit 747c86629c17dea568f845016725ec26d5a3ed8d)