Check constant existence before defining it

Reference issue #23