added if binding tests

and bug fixes