Removing puning of ints to doubles and viceversa, and implementing use of scaling factor from metadata