Fix bugs

-Line 17: missing variable name value pair
-Line 48: breaking non existent loop