Zero padded the returned and logged HTTP status code, and fixed possible buffer overrun in $status handling.