Removed debug code and made debug print more generic.