Update DI/1 to 0.5 and minor code cleanup