Add layout support for iPad
Fix message debug log crash