some bugs fixed

Signed-off-by: Douglas Silva <douglas_hss@hotmail.com.br>