Fix switch conversion in offloading functions