Issues #1303 and #1337

* Actual fix for issue #1303.
* Possible solution to issue #1337.