Updated output tools. Finally fixes #1