Small improvements in the code