Fix bug "Directions constructor does not allow HTMLElement" reported by ca0v.