Fixes null args and html escaping bugs.