added a null check that may avoid #37, although I can't reproduce it and can't see how it could come to that. possibly mcpc+ related.