bugfixes to range processing