Cast timeout properly to avoid int cast bug.