fixes, end-to-end tests

@feiranwang Add comment explaining the importance of columns order.