Part of #616
Part of #616