Fixed undefined constant and updated swift