Function to calculate flag byte as well as a few updates to message option lists.