Fixed study number digit display
add data to  stderr messages
added optparse to auto_message_tool