fix line from auto spacing by msvc
fix by giulio
better error handling
Merge pull request #45 from tqchen/master

better error handling