Some edits that take care of type problems, everything should compile.