fix #135 I'm not getting any exceptions now, but it needs to be tested more.