Rewrite take() stored procedure to correctly consider order parameter. Fix issue #8