Fixed javascript bug in key initialization.