Fixed memory leak.
Don't stomp at address 0.
Clean up the loop a bit.