fix issues pointed out by alberto