fix subassembly conditional check for manips and make some vars local