Added timeout management (with -t on command line)

I think this patch fixes timeout management issue #11.