Corrected some compiler warnings.
Corrected some stuff, added some tests, and added TODO comments