Fix tests not passing in valgrind

Change-Id: Iad5730dd2a5d566f4f68ed5845ab63647c03cd1c
Signed-off-by: Saggi Mizrahi <ficoos@gmail.com>