Solved a minor issue with layer.temperature calcuation.