Changed the type of tval.