Array sort function should return an integer not a boolean. Issue: #527