some bug fixing

contains a fix for #87 and another small fix for linux.
see comments in issue #87