Implement #336, see issue for info on what to upgrade