bug fix and style cleanup

finally get some time back to work on the directive now ;p