Fixed wrong code generation for expansion box ports when set to opposite cycle
close #17