Unwrap optionals (fixes #728)