Fix vertical legend alignment, enhance --legend-direction

See issue #419