Use `getattr` with default instead of `if hasattr/else`
Merge pull request #468 from dmedvinsky/minor_stuff

Use `getattr` with default instead of `if hasattr/else`