Thanks everyone for all the initial comments and feedback! I've updated the code to fix the two small problems that were reported to me.
Have you seen this project which is going in a similar direction? http://sourceforge.net/p/openlte/home/Home/
Actually, I've exchanged a few emails with Ben and his code helped me with several parts of my code. I've now added a link back to his project in the README.
BR, James