Added tests for Ok (and fixed some bugs that testing revealed).