Latest attempt. Fixes a missing return statement.