fix consecutive and deep nested tiles (closes #18 and #19)