Fixed order.statement when joining other tables
Fixed join statements if fields have same name as AR
Merge dev to master and resolve some conflicts