Fixed selection of some layers when layerRecord was null.
Fixed selection in map.
Removed .pdf so it's not duplicated in the output.