Fixed bug occurring with strange shapes