Implement sane handling of nested frames.