Fix for #252 with broken logic on saving Layer.
Merge pull request #264 from aodn/issue252

Fix for #252 with broken logic on saving Layer.

Fixed for me and tests pass.