Fix notice where end() required a reference