Ignore empty nodes when counting position (fix #46)