Fixed handling of constant values and port swapping in subcircuit library