Optimize 'expr' usage and few indent fixes.
Fix string comparison by 'expr'.