Move some functions to compat