fix regression in build_psr (segfault)