fixed minor flaws