Fixed output ordering.
Fixed bugs.
Proper ordering of returned information.