Modifications to make it work across more environments.