Actually handle shutdown better