Fix mono shutdown