Fixed old warnings, and added basic tests