Images no longer run out after several restarts. Tie state added.
Merge pull request #8 from rap/master

Tying works