Fix some bugs.

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>