Thanks for your suggestions. However it seems it was just 'one of those things'. I removed the class from my project, added a new class and copied all the code into it and it worked.

Perhaps it was just corrupt in some way?