Avoid double declarations, integer overflow, and use branch hints