Fix compile warning and break from for loop once complete