Improvements and little bug fix.