Added changes that didn't get commited previously and some cleanup