Fix build. and some small local changes.