png_lookup, curve_*, bugfixes