Convert argument to integer

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Only catch KeyError (missing parameters)

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>