Added Mageia support and fix some bugs