Some fixes for changing keys doesn't save the change correctly