Resolved issue #9 and fixed issue #12