Added compile error if return statement isn't in function