Fix null pointer exception

Fixed the sendMessage method call trying to print null, uninitialized
strings in the output array because it did not size properly when the
number of elements were less than the default page length.