serial: fix constructor bug