#4 bug fixes (after further tests)