Fixed crash due to locale settings.