Fixed a bug where it could still pick the end() iterator

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>