Improved branch coverage tests