Added support for multi-frames.
Added test cases