Additional checks for polygon statement 

Fixes #158 - please review carefully, if I didn't do any silly mistakes.