Important fix for several bugs related to image scaling and a plain-op typo.