Fixed bug in unit object editing