Bug fix and improvement.