Several bugs fixed when parsing psgrid