Optional<> unit tests and some more fixes.