Various improvements & bug fixes