Merge pull request #183 from dejan-brkic/master

CRAFTERCMS-650
CRAFTERCMS-660
Fixed NPE caused by transaction scopes.