Minor improvement and bug fix.