Fixed stdin problems