Fixed a nasty bug which would sometimes cause locals to not be properly set to nil.
Implemented table.sort.