Minor bug fix and GCLK refactor