The solutions are perfectly fine and you don't need another one. Just declare functions that do not return anything as void and the other ones with the corresponding type.
Code:
function foo()
{
    return 1337; // Always return values from functions.
    // When using "function" returns a var, when using int return an int etc.
}

void bar()
{
    return; // Don't return a value when using void.
}



Always learn from history, to be sure you make the same mistakes again...