Fixing typeof checks in request