Updating margin properties to be more robust