Fix problems in incomplete options for CreateCatalog and sonar refactor code