CBD-1431:  fix typo, better scalar statement, dont forget undefs

Change-Id: I71f45f1be18ca137fc681b58ad6e3704a6af70f4
Reviewed-on: http://review.couchbase.org/40817
Reviewed-by: Philip Labee <philip@couchbase.com>
Tested-by: Philip Labee <philip@couchbase.com>