Changed boolval to !! (not supported in PHP < 5.5)