use internal object id cast instead of copy
fixed mem-leaks in Reference::rename and Reference::move