Use `frames` stack only where necessary.

Closes #244.