some custom stuff from mangosR2 and some warning fixes