add spec files, and small bugs fixed