Add return types to limit and sample