Minor bugfixes to close issue #1