Fix overflow in scaling algorithm.
Add comment about the need to set the keyframe flag.
Merge branch 'master' into glinject-next