Corrected get_serial_number call & added close().

It doesn't look like the call to close is actually needed currently but I thought it might be better to include it as a suggested practice just in case it eventually does more.