Fix timer:get_remaining_time() always returning 0. Fix #503.