Some minor changes in the implementation.