Fix BTerminalIOHandler; improve building process