Bug fixing and comments

Signed-off-by: Carlo Caione <carlo@caione.org>