Improvements based on earlier comments from tjm and some todo-markings