Fixed magnets bugs (I hope)