Fix #55 by building paths more intelligently