fixed error messages due to invalid graphics context (fixes phatblat/#1)
Merge pull request #2 from drallgood/master

fixed error messages due to invalid graphics context