Added error handling and fixed NPE in translation service generator