Make tests for attribute changing more robust.