Copied over changes from ELB plugin repo.
Additional changes manually copied over from ELB repo.