Fix getter of params and session variables. 

TypeOf is better. InstanceOf sometimes broken.