Fixed crash (#938)