bug fixes and tests for teh request module