Cherry pick fixes for #51 and #58 (closes #64)

Backport fixes for login issues caused by custom route mount point.