Cleanup.
Implementing check for whether scheme can be opened before opening the schemeURL.
Original patch by @boyvanamstel.