Slightly changed flag handling, -c option added for backward compatibility