Use NONE for ecp is there is none specified for the atom.
Added missing else statements.