Fix for libpng 1.5 and to compile on 64-bit Apples.