Minor code improvements.
Code fixes/improvements to the last merged PR.