Small improvements to the code.