Fixed referenced before assignment error.

Signed-off-by: Stefan <stefan.virtanen@abo.fi>