Fixed some bugs in SDF parsing