Few enhancements and a bug fix.