Obvious bugs (thanks Felipe!) in prior patch.

NTS: Review this changes as time allows, you are triple-tasking right
now.