Fix possible exception in toCamelCase method