Fixed JS not being output bug for certain themes, centralized debugging statements