An honest attempt at bug-fixing. No more error messages from innerHTML at least