Fixed some serious bugs.
1. CRLF problem
2. convert to int (I don't know why)