Fix polygon bugs