Check return value of l.rest() when an expression/statement is expected.

This prevents problems where we let a None pass into some other
part of the code:

See: <00b201cfdc7e$c7d24530$5776cf90$@gmail.com>