Several bug fixes

Still a bug on create order.