Added handling for IF WHEN UNLESS functions