fixes, end-to-end tests

@feiranwang  You must update the comment on line 33. Also please do not just comment out code. If the code is useless/dead, remove it. Don't leave commented out code that "future people" will wonder why it is commented (line 47)