Smallfixes

Hi Guys,
Since this project has been resurrected, here are some fixes we've been using for our project which I thought I'd put in a pull request and send through. Let me know what you think :)

Cheers,
Mark