fixes, end-to-end tests

@feiranwang  Same comment as before about toLowerCase()