Fix bug on function bound check.