Note: `if not x:` has changed to `if x is not None:`, changing the semantics slightly. Shouldn't be a big issue.