Workaround for null index bug in set_pinv()