Overall hardening of the code

- Overall hardening of the code
- Expansion of regression testing

Change-Id: Ib62aae644d85e47ee8c14fc8566556db413082aa
Signed-off-by: Reinaldo Penno <rapenno@gmail.com>
(cherry picked from commit 0ed2f0614b0076e3fbe22b2beedae52df0b9c28e)