Several minor improvments