Some additional fixes and modifications