Fixing many minor issues