Improvements and several fixes.