Fixed usage of session's wait timeout