A few enhacements of the code.