Added more specs to ensure the libary is robust to errors