fixed #55; pin export modified to check existing export state and pin direction before re-exporting.