Fix OSX Termination and upgrade sql alchemy version