minor fixes in lots of places, but nedpy is still very broken and maybe
cannot be fixed