Fix pad function to work for negative widths (RHBZ#634435).