Fix cut+paste, typos and some implementation bugs (nw)