Cleanup code and fixed some posssible NPE

Fixed bug with new Group/Symbol system