fixing NPE, unsupported Exception and internal repo issue