Leonard William Hartley, 1775-1815