Richard, wow I wasn't aware of this issue. Check out the following article. It explains in detail exactly what happened in my code.

https://download.mikroe.com/document...c/help/rmw.htm