Add some functions from numbagg