Use table attribute instead of string in database order by (probably fixes #59)