Impement patch to prevent fatal errors, see #313
Merge pull request #314 from laterpay/feature/313_fatal_error

Impement patch to prevent fatal errors, see #313