Data ArrayList thread-safe

Made the ArrayList<String> data thread safe, fixed potential
NullPointerExceptions and strange errors. Also misc changes.