Minor code improvements after CR