Fix: use the correct var in the if statement
Improve: give priority to validators
Fix: prevent multiple validator registration
Fix: handling of return value

Before, an input like string(1) "0" returning "int(0)" was incorrectly
handled. That is due to boolean conversion, which treats string(1) "0"
as false. Therefore, the if statement must explicitly check against
false.