Count shortcirtcuited if ($a || $b) and unless ($a && $b) correctly
Always return something.
Put guards around code for 5.20.
We need to work with threads too.
Merge branch 't_fixes_for_520'