Merge "Implement saveLayer*() correctly"