Fixed test syntax and logic issues