Fix pre-condition to accept type used at runtime
Fix tests for error handling on order-by 'order' value