Set default to None for get_variable

Otherwise an UnboundLocalError is raised.