magnids support

* Add code update from 1.34.161.
* restore comments in files
* add support for magnids