Check this thread for the login problems, I think it's a cookie issue (if I recall correctly):
https://vborg.vbsupport.ru/showthrea...ight=tools.php (I know I've seen better posts about using tools.php, but I can't find them right now)
For number 2, is line 983 the last line? I remember something like that happening for me before - there was some extra character somehow added. Copy/paste that last line from a 'working' page and see if that fixes the issue.