Merge "Replacing CHECK_BOUNDS macro with inline check_bounds function."