Fixed adjustReplacementRange: to not return location outside [input lenght]