Fixed int casting problems in session