bunch of bugfixes in HTML, Exception and Database classes