Fix savepoint management