Now fixes multiports for input and output as well as state