Export new function, fix tests