Savings = investment with private money creation? I've been reading some introductory macroeconomics and I'm struggling to understand one of the basic accounting identities. In a closed economy with a fixed money supply it's clear that every dollar saved is a dollar invested. I'm happy with the standard story.

What I don't understand is how the identity works when money is created privately. I can go to a bank an ask for a million dollar business loan. The bank grants me the loan, and creates an asset (the loan) and a liability (the money in my account). I then invest the money. It seems from this example that I have created a million dollars of investment without creating any offsetting savings. Of course, I have to pay off the loan at some point, but then shouldn't the identity be something like investment = savings + debt?

What am I missing?
Say you take out a \$1m loan from ABC Bank - they create two entries on your books:

Assets: \$1m cash available funds.
Liablities: \$1m loan you owe the
bank.

Similarly on their books they create two entries:

Assets: \$1m owing from Simon Lyons
Liabilities: \$1m payment we must honor.

Now you buy a factory with the \$1m. You write a cheque to Bob who you're buying the factory from. He banks with XYZ bank.
Your books:

Assets: A factory worth \$1m.
Liabilities: \$1m loan you owe the bank.

The bank's books:

Assets: \$1m owing from Simon Lyons
Liabilties: We owe \$1m to XYZ bank.

In practise what happens is that the banks are exchanging money between each other all day (for example XYZ bank customers may have paid cheques to ABC bank customers), and at the end of the day they need to settle the difference by taking a loan from someone.
In New Zealand's system for example, that difference can be borrowed from the Reserve Bank (New Zealand's central bank) - paying interest at the Official Cash Rate (OCR). This rate is set by the Reserve Bank - and is the primary means that the Reserve Bank controls inflation.