Added option for ignoring null in buildBuffer.