Updating popup_HTML.sql to handle null values, etc

#232, #140, #207