REPORT-553 - fixed ordering and added tests