Avoid endless recursion when changing view from onFrame handler.

Closes #184.