Move function to compat.