Fixed site specific calls in layout where site may not be available

Main code rev. 1747