Fix imports and serial port initialization