[MERGE] more fixes. Cleanup code

Signed-off-by: David Goulet <dgoulet@ev0ke.net>