Minor code updates

Please review some updates.