Small improvements

Two small improvements to the code.