fixed Stack class to use new SafeReadWriteRepAccessor and AssertRepValidType