Fixed errors on editing