made negation more explicit
fixed bug
use ht_snprintf