Fix error when setting enable_ipv4_localhost to false

Fixes github issue #14