Fixed minor bugs in cms