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