fix moments for invgamma

Yesterday I've erroneously reported that gh-1866 has been fixed. This patch actually fixes it.