Add features and fix bug.