Fix for #238

@settinghead please review