Added checks for incorrect usage of innerHTML. Fixes #1370