Fixed the addclass database bug. Added functions.