Fix overwritting of non object value
Add overwritting tests