few bug fixes, also closes #70