Some code improvements.