Fixing a small bug in the order by.
Fixing a few small bugs which prevented updates from occuring.