Fixed bugs for reading LPS, added exception handlings