Fixed bugs and made many enhancements.