Fixed errors, restored sessionrepository as it should be