Thanks for the quick response. So this means that I have to shoot in RAW and set Dark frame substraction to ON or auto?
Does this work for jpegs too?
Do I have to turn on Bad pixel too? and if so how should i set it? average or Raw Convert?
Without CHDK, your camera always uses dark frame subraction for long exposures. With CHDK you can turn it off if you like, but by default it's still "AUTO" i.e. the camera decides whether to use it like it would without CHDK.
So no, you don't need to shoot RAW. This option just happens to be located in the RAW menu. Bad pixel removal is complete separate from this, no need to touch it.
But that purple coloring you're seeing in the corner may not go away completely with dark frame removal, because the sensor temperature changes during the exposures. Maybe your shots were actually taken with dark frame removal and turning it OFF will reveal you the extent of the problem (some of these artificial software limits we break with CHDK really aren't there just to sell more DSLRs...without 15 second Tv limit there would probably be a number of people who thought their camera was broken when it's just not good enough for the job).
You know for sure dark frame removal is active if your long exposures take twice the Tv.
An easy solution around this is to shoot wide angle and crop the bad area away in post processing. It's always the same corner that will go bad first.