fix(magnet): Fix invalid magnet algorithm implementation

Close #291