Updating/fixing code w.r.t. all the recent changes.