fix structure bug

This should fix TWK-1837 and TWK-1963.