Fixes a few issues with PLC-based mode switching