Make HashMap implmentation switchable

Enable iterator debugging in DEBUG builds

Removed a dereference of end() while building workitems from drawables.