Bugfix. Duplicate if conditions in PeripheralController.java