fix services module to work with certain broken services which have extra newlines at the end of their output