Minor enhancements and bugs fixed