Fixes

See commit log for details.