Fix typo.
Fix bugs and make more idempotent.