Fix check mode and is_build_needed