allow r173 and make a fix for subsequent calls to get_mags with identical parameters returning differnt results