Added checking for return type mismatches
added checking for breaks outside of loop