FIX: fixed input stream parsing