fixed some smaller glitches and hopefully the crash documented in issue #31