Fix defects, add more specs.