Add exit code to error. Also fixed cases where some specs would pass if a specific error was expected but no errors were raised.