Fix some confusion around timescale parameter and move code update call out of inner update loop