Updated to address concerns from @cpoulain.