Bug fixes; populating tests