Fixed some concurrency bugs.  Streamlined onWritePossible.