Fix subdomain, add test, space and comment fix

Cleaning things when learning the code. 
@shuoli84 great, my mistake. I ignore the return slice length