Fix linking and initialize locale