Fixed hashmap bug that was causing free() errors
fixed off-by-one bug