Refactored frame blending and fixed a few bugs.