Fixed implicit DB session handling.