cleanedup endMap / beginMap bugs