Fix nested layout bug

Closes #3