Various fixes, new shutdown() method