forward fit of e6282d75a6321f8584e95bcb21d15aa3a2a3c413

The changes needed in 1.4.5 differe slightly, so they have been adapted.