Trim inputs (see 4217c2d)