Fixed some printing bugs