Some corrections and functionality additions