More functionality added. Minor fixes merged.