Fixed issue that if there was no callback given the script gave a error,
Fixed issue that the script would give a error if you wanted to close the connection