fixes #41, fixes #42, fixes #43 + some other changes