Cleanup and corrections, based of @filinep's comments.

Signed-off-by: Gary Pamparà <gpampara@gmail.com>