Enhance timeouts

This should fix #33, and enhance #25