Updated and added unit tests