Added some todos and fixed the return type checking.