Bug fix and renaming.
More test functions.
Added comment.