Fix magnet recognition