Fixed bugs when first time installation

Fixed some bugs related to initial configuration.