Make getSession return a reference
Better syscall implementation