Fix multiple issues with getSourceName

* Update `getSourceName` implementations to adhere to the documentation (fixes #667)
* Added several additional `@NotNull` and `@Nullable` annotations