Prepare values for storing in database.