fix some findbugs reproted problems, especially possible null pointer dereferences to BufferedReader.readLine()