crash/hang fixes by DMichael

Credit: https://forum.tuts4you.com/topic/36574-fixed-scylla-097b/