fixed minor coding issues in conditional statements