Bug fixes; added membership tests.