Bilinear interpolation optimization on the affine operation and minor fixes