Well 5.1 should be alot faster sleeker and mean
I would ensure you download the build again and reupload all files. I mean you can theoritically here to make sure you properly overwrite the files delete everything except uploads data directories and any header footer and config files.
If you have some old and new files you could get this error but usually this is server related totally. Your server error logs can give you a better indication of the exact nature of the error that is happening.