added referer based return url detection and fixed a couple of minor iss...

...ues with signin page