Fix range auto-detection #135