Problem of trapeze resolved taking the min and max values of extent (fix #36)