Minor code fixes