Small change in magnets.lua to make api functions do what they say they do