Fixed few cases that would break the system. Added class.