Warnings for bad return numbers and number of returns.

close #617