Scope error.

TODO make tests for internal transactions.