Fixed custom width adjustment function