Fix 'local variable 'x' referenced before assignement' error

Fixes #36

Signed-off-by: David Scott <dave.scott@eu.citrix.com>