Fixed an error in one of the PNG handling functions.