Bug fixes

Bug fix in readPIM