Various fixes

See comment messages