Fixes https://github.com/ansible/ansible-modules-extras/issues/1910 and https://github.com/ansible/ansible-modules-extras/issues/1843