fixes bug 910304

These functions raise warnings because they do not always return a value. The fix is to return undefined in the worst case scenario.