Index: src/Actions/AtomAction/AddAction.cpp
===================================================================
--- src/Actions/AtomAction/AddAction.cpp	(revision 6c7352cd441286633d02a559a31f6b99a0e2658f)
+++ src/Actions/AtomAction/AddAction.cpp	(revision f0a3ec30883f7671a6d9b42f3fef781efea8f232)
@@ -10,5 +10,5 @@
 #include "element.hpp"
 #include "log.hpp"
-#include "periodentafel.hpp"
+#include "molecule.hpp"
 #include "vector.hpp"
 #include "verbose.hpp"
@@ -35,21 +35,28 @@
 Action::state_ptr AtomAddAction::performCall() {
   Dialog *dialog = UIFactory::getInstance().makeDialog();
-  int Z = -1;
+  std::vector<element *> elements;
   Vector position;
 
-  dialog->queryInt(NAME, &Z, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryElement(NAME, &elements, MapOfActions::getInstance().getDescription(NAME));
   dialog->queryVector("position", &position, World::getInstance().getDomain(), true, MapOfActions::getInstance().getDescription("position"));
+  cout << "pre-dialog" << endl;
 
   if(dialog->display()) {
+    cout << "post-dialog" << endl;
     delete dialog;
-    atom * first = World::getInstance().createAtom();
-    first->type = World::getInstance().getPeriode()->FindElement(Z);
-    first->x = position;
-    if (first->type != NULL) {
+    if (elements.size() == 1) {
+      atom * first = World::getInstance().createAtom();
+      first->type = *(elements.begin());
+      first->x = position;
       DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << first->type->name << " at " << (first->x) << "." << endl);
+      // TODO: remove when all of World's atoms are stored.
+      std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
+      if (!molecules.empty()) {
+        std::vector<molecule *>::iterator iter = molecules.begin();
+        (*iter)->AddAtom(first);
+      }
       return Action::success;
     } else {
       DoeLog(1) && (eLog()<< Verbose(1) << "Could not find the specified element." << endl);
-      World::getInstance().destroyAtom(first);
       return Action::failure;
     }
Index: src/Actions/MapOfActions.cpp
===================================================================
--- src/Actions/MapOfActions.cpp	(revision 6c7352cd441286633d02a559a31f6b99a0e2658f)
+++ src/Actions/MapOfActions.cpp	(revision f0a3ec30883f7671a6d9b42f3fef781efea8f232)
@@ -164,5 +164,5 @@
 
   // value types for the actions
-  TypeMap["add-atom"] = Atom;
+  TypeMap["add-atom"] = Element;
   TypeMap["bond-file"] = String;
   TypeMap["bond-table"] = String;
@@ -210,5 +210,5 @@
   TypeMap["distances"] = Vector;
   TypeMap["DoRotate"] = Boolean;
-  TypeMap["elements"] = Element;
+  TypeMap["element"] = Element;
   TypeMap["elements"] = ListOfElements;
   TypeMap["length"] = Double;
@@ -230,5 +230,5 @@
 
   // list of generic actions
-//	generic.insert("add-atom");
+	generic.insert("add-atom");
 //  generic.insert("bond-file");
 	generic.insert("bond-table");
@@ -434,7 +434,5 @@
             ListRunner->second->add_options()
               (getKeyAndShortForm(*OptionRunner).c_str(),
-                  DefaultValue.find(*OptionRunner) != DefaultValue.end() ?
-                        po::value< int >()->default_value(atoi(DefaultValue[*OptionRunner].c_str())) :
-                        po::value< int >(),
+                  po::value< vector<int> >(),
                   getDescription(*OptionRunner).c_str())
               ;
Index: src/builder.cpp
===================================================================
--- src/builder.cpp	(revision 6c7352cd441286633d02a559a31f6b99a0e2658f)
+++ src/builder.cpp	(revision f0a3ec30883f7671a6d9b42f3fef781efea8f232)
@@ -1681,24 +1681,16 @@
             case 'a':
               if (ExitFlag == 0) ExitFlag = 1;
-              if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3]))) {
+              if ((argptr+4 >= argc) || (argv[argptr][0] == '-')) {
                 ExitFlag = 255;
-                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for adding atom: -a <element> <x> <y> <z>" << endl);
+                DoeLog(0) && (eLog()<< Verbose(0) << "Not enough arguments for adding atom: -a <Z> --position <x> <y> <z>" << endl);
                 performCriticalExit();
               } else {
-                SaveFlag = true;
-                Log() << Verbose(1) << "Adding new atom with element " << argv[argptr] << " at (" << argv[argptr+1] << "," << argv[argptr+2] << "," << argv[argptr+3] << "), ";
-                first = World::getInstance().createAtom();
-                first->type = periode->FindElement(atoi(argv[argptr]));
-                if (first->type != NULL)
-                  DoLog(2) && (Log() << Verbose(2) << "found element " << first->type->name << endl);
-                for (int i=NDIM;i--;)
-                  first->x[i] = atof(argv[argptr+1+i]);
-                if (first->type != NULL) {
-                  mol->AddAtom(first);  // add to molecule
-                  if ((configPresent == empty) && (mol->getAtomCount() != 0))
-                    configPresent = present;
-                } else
-                  DoeLog(1) && (eLog()<< Verbose(1) << "Could not find the specified element." << endl);
-                argptr+=4;
+                ArgcList.insert(argptr-1);
+                ArgcList.insert(argptr);
+                ArgcList.insert(argptr+1);
+                ArgcList.insert(argptr+2);
+                ArgcList.insert(argptr+3);
+                ArgcList.insert(argptr+4);
+                argptr+=5;
               }
               break;
@@ -1738,5 +1730,5 @@
                 bool periodic = (argv[argptr-1][2] =='p');
                 if (ExitFlag == 0) ExitFlag = 1;
-                if ((argptr >= argc)) {
+                if ((argptr+11 >= argc)) {
                   ExitFlag = 255;
                   DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C[p] <type: E/P/S> [more params] <output> <bin output> <BinStart> <BinEnd>" << endl);
Index: tests/regression/testsuite-simple_configuration.at
===================================================================
--- tests/regression/testsuite-simple_configuration.at	(revision 6c7352cd441286633d02a559a31f6b99a0e2658f)
+++ tests/regression/testsuite-simple_configuration.at	(revision f0a3ec30883f7671a6d9b42f3fef781efea8f232)
@@ -25,5 +25,5 @@
 AT_SETUP([Simple configuration - adding atom])
 AT_KEYWORDS([configuration])
-AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -a 1 10. 10. 10.], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -a 1 --position 10. 10. 10.], 0, [ignore], [ignore])
 AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
 AT_CHECK([file=test.conf.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
@@ -53,5 +53,5 @@
 AT_KEYWORDS([configuration])
 AT_CHECK([../../molecuilder empty.conf -e ${abs_top_srcdir}/src/ -t -s -b -E -c -b -a -U -T -u], 255, [ignore], [stderr])
-AT_CHECK([fgrep -c "Not enough or invalid" stderr], 0, [1
+AT_CHECK([fgrep -c "Not enough" stderr], 0, [1
 ], [ignore])
 AT_CLEANUP
@@ -62,23 +62,23 @@
 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/7/pre/test.conf .], 0)
 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -t], 255, [ignore], [stderr])
-AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
+AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -s -b -E -c -b -a -U -T -u], 255, [ignore], [stderr])
-AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
+AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -b -E -c -b -a -U -T -u], 255, [ignore], [stderr])
-AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
+AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -E -c -b -a -U -T -u], 255, [ignore], [stderr])
-AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
+AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -c -b -a -U -T -u], 255, [ignore], [stderr])
-AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
+AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -b -a -U -T -u], 255, [ignore], [stderr])
-AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
+AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -a -U -T -u], 255, [ignore], [stderr])
-AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
+AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -U -T -u], 255, [ignore], [stderr])
-AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
+AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -T -u], 255, [ignore], [stderr])
-AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
+AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -u], 255, [ignore], [stderr])
-AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
+AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
 AT_CLEANUP
 
