Added testcases for Publish and a few enhancements #