Might just want:

```scala
Try(a.getN.toLong)
```
to catch the errors for sure.