fixed spec parser bug and substitute null bug