range bugfixes