Fix status_code checking