PartialLoop: rewrite input check even better