Various minor improvements to follow good practice