It's just because the order in which the script creates the four stored procedures.
If you change it so that is creates them in the following order it will not produce those messages: -
spX_check_activeconnections
spX_SendDBMailOperator
spX_RebuildIndexes
spX_RebuildIndexes_Main
Also add the change suggested by Ken Davis above so that rebuild works as intended.