many fixes including issue #41