Fixed error on output causing truncation. Closes #173