Fix crash when profile not specified

Not changed here, but this seems icky.