Added checks for incorrect usage of innerHTML. Fixes #1370

Double space at the end here. One is enough. :)