added bleeding detection. polygon operations may now return NULL on error