Adding check around unsanitized prefix

@charleso @markhibberd 
Were we going to make this private to avoid pattern matching? /notsure