layout: Address review comments and add a test for lengths