TODO: fix incorrect handling of NLs

Signed-off-by: Andrew Tselischev <andrewtselischev@gmail.com>