MAINT: better fix for subclass writeable flag preservation
MAINT: fix a compiler warning
Merge pull request #4847 from juliantaylor/writeable2

better writeable flag fix