Two bugs with usernames starting with subfolder name

Fixed with that PR

https://github.com/discourse/discourse/pull/11786