prepare release 0.4; use -safe-string, replace deprecated functions