Fix improper cap check