Add tests for creating chains
Fix cycle