Attempt to fix reflection InvocationTargetException