fix variable name mistakes
fix constant definition check