there is a mistake

// returns 2, which is true
foo && baz;

//should be
bar && baz