Compiler - refactor of PSGetIndex/PSSetIndex to be typed