fixing some errors highlighted by enrico