Improved dotpath to always create and preserve if needed