Security and compatibility fixes by Hans-Michael Varbaek of Sense of Security