Improved ordernumber generation and fixed made better tests