Fixed some bugs with texture scaling