Minor code improvments