Fix load function for tests