A very import thing to remember: a browser is very forgiving; check50 is very precise. So, while things may look ok in the browser, they are not perfect according to check50. And since check50 says what your grade will be, who you gonna believe? :)
Since all the tests fail, it's time to use gdb to help you narrow down the problem (find tips herehere). I suggest you set breaks at the function calls and evaluate the returned values, especially since pointers are the point. You values can look fine inside a function, but if the wrong value is returned to the caller, failures like this will occur.
If you get stuck on a particular function, post a new question about the specific function and specific problem. Good luck!