Modify reader and fixed bugs