fix bugs of range and vector