Fixed cast exception on modify and remove caused by not handling representative properties correctly in modify resource.