Refactored to insert via string to allow invalid values to be handled.