Cleaned up const_cast in dim_iter