Minor code improvements