Fix error reporting of activate/deactivate when not sourced but executed