Fixed bug when printing characters in input, fixed a bug when select was interrupted by system call