Fixed circular dependancy that was causing issue. Modularized version seems to work fine now.