Simplified implementation of `runSafeP`