Change test methods, small fix for session factory