Previously, the function would only return when a STOP was issued. It makes more sense to consider all possible commands.