Fixed some issues due to latest code reorganization