Fixed bug when removing layer name from Session. This could be the cause of issue #172, but not certain yet.