QTR 8RC White line detection
I haven't used the QTR sensors myself, but I noticed that the main difference between your code and the examples I found floating around is that you are calling readCalibrated(val) before readLine and the examples don't. I looked through the source for the libary and readLine calls readCalibrated in the first couple of lines anyway. Maybe pre-loading val is with the calibration values is causing the problem?

Also, are you passing the sensor over both the white and black surfaces during the calibration? A trick could be to get the bot to slowly spin on the spot during calibration, while sitting on the line, allowing the sensor to see both the line and the surrounding area.