Fix SNS topic, subscription, and permission bugs.