Fixed slight bug in frames that was causing the wrong frame to be returned.