After an acrimonious debate over whether dangerous criminals would be released to the streets before their sentences expire, the state Senate narrowly agreed Thursday to make sweeping changes to the correctional system to relieve severe overcrowding in state prisons.