Not related to your changes but shouldn't this be `return err`??? @vieux