Improvements and other bug fixes.