Fix variable where 0 should be