Added direction helper.

Fixed few bugs.