Fix boundary scaling issue