Fixed bugs in playback view. Improved code organization.