Fix an issue with typecasting of booleans, now using filter_var() for that purpose.