Finished tests. Corrected a bug.