Small improvements

- Fix warnings
- Add support for specifying the timeout