Fixed a couple of recurring js errors in the rule view and markup-view