Fixes

An important fix and a few minor ones.