Added previous function and exception test.