Allow custom functions return types defined within less

More generic type checking for custom function return