diff --git a/debian/ifenslave.if-pre-up b/debian/ifenslave.if-pre-up
index 16c8aa6..13d3575 100755
--- a/debian/ifenslave.if-pre-up
+++ b/debian/ifenslave.if-pre-up
@@ -193,7 +193,7 @@ setup_master_device() {
 
 setup_slave_device() {
        # Require the bond master to have an iface stanza
-       if ! ifstate -l "$IF_BOND_MASTER" 2>/dev/null ; then
+       if ! ifquery -l "$IF_BOND_MASTER" 2>&1 >/dev/null ; then
                echo "No iface stanza found for master $IF_BOND_MASTER" >&2
                exit 1
        fi
@@ -203,13 +203,13 @@ setup_slave_device() {
        IFUPDOWN_IF_BOND_MASTER="$(printenv "$IFENSLAVE_ENV_NAME")"
        unset IFENSLAVE_ENV_NAME
        if [ -z "$IFUPDOWN_IF_BOND_MASTER" ] ; then
-               ifquery --state "$IF_BOND_MASTER" 2>/dev/null || ifup "$IF_BOND_MASTER"
+               ifquery --state "$IF_BOND_MASTER" 2>&1 >/dev/null || ifup "$IF_BOND_MASTER"
        fi
 
        # Enslave it to the master
-       ip link set "$slave" down 2>/dev/null
-       if ! sysfs_add slaves "$slave" 2>/dev/null ; then
-               echo "Failed to enslave $slave to $BOND_MASTER." >&2
+       ip link set "$1" down 2>/dev/null
+       if ! sysfs_add slaves "$1" 2>/dev/null ; then
+               echo "Failed to enslave $1 to $BOND_MASTER." >&2
        fi
 
        setup_primary
