Few fixes to control may reach end of function warning