fixed ticknum and math refs