Functions without return statement should return undefined.

Closes #1.