Various fix and a typo (thanks to Calogero Mauro Buscemi)