Fix for null range bug