Fix incorrect flag handling.

Change-Id: Idfa5b2176d159bd18bb3ae78f6f98af8237d9db4
Reviewed-on: http://review.couchbase.org/36094
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Brett Lawson <brett19@gmail.com>