Fixed bug in saving TGA.