Update magicpath.php

Simplification to try solve #1.