Improve oauth2provider tests
Improve error control while processing widget html files. Fixes #28