Fix bug on function bound check.
Remove warnings from macro compilation.