Correct bug and add new features

This is important.