Some refinements and small fixes