First cut with valid unit tests (only partial coverage though).