Handle object assignment better