Fix getidx and context population.

Signed-off-by: katlogic <kat@lua.cz>