Added a configurable timeout value (Fixes #1).