Bug fixes

Signed-off-by: Marcello Angileri <marcelloangileri@gmail.com>