Fix ArrayOutOfBounds when body array's size is 0

Force the page generator to build a page even when there is no body
specified, or when the body is empty. The problem may still exist when
no header and footer is specified.